touch /etc/NetworkManager/conf.d/rke2-canal.conf
echo "[keyfile]" >>/etc/NetworkManager/conf.d/rke2-canal.conf
echo "unmanaged-devices=interface-name:cali*;interface-name:flannel*" >>/etc/NetworkManager/conf.d/rke2-canal.conf
systemctl daemon-reload
systemctl restart NetworkManager

# curl -sfL https://get.rke2.io | sh -

curl -sfL http://rancher-mirror.rancher.cn/rke2/install.sh | INSTALL_RKE2_MIRROR=cn sh -
systemctl start rke2-server
systemctl enable rke2-server

#   systemctl status rke2-server.service
mkdir $HOME/.kube
ln -s /var/lib/rancher/rke2/bin/kubectl /usr/local/sbin/kubectl
ln -s /etc/rancher/rke2/rke2.yaml $HOME/.kube/config
#   kubectl get pods --all-namespaces
# touch /etc/rancher/rke2/config.yaml
cat /var/lib/rancher/rke2/server/token
